import React, { Component } from 'react'
import {HashRouter as Router, Route , Switch, Redirect} from 'react-router-dom'
import Bookrack from './component/Bookrack/Bookrack'
import Booktown from './component/Booktown/Booktown'
import Sort from './component/Sort/Sort'
import My from './component/My/My'
import Seek from './component/Seek/Seek'
import Detailed from './component/Detailed/Detailed'
import Comment from './component/Comment/Comment'
import Login from './component/Login/Login'

class App extends Component {
  render() {
    return (
      <Router>
        <Switch>
          <Route exact  path="/bookrack" render={(props) => <Bookrack {...props}></Bookrack>}></Route>
          <Route exact path="/booktown" render={() => <Booktown></Booktown>}></Route>
          <Route exact path="/sort/:group" render={(props) => <Sort {...props}></Sort>}></Route>
          <Route exact path="/my" render={(props) => <My {...props}></My>}></Route>   
          <Route exact path="/seek" render={(props) => <Seek {...props}></Seek>}></Route>
          <Route exact path="/detailed/:id" render={(props) => <Detailed {...props}></Detailed>}></Route>    
          <Route exact path="/comment/:id" render={(props) => <Comment {...props}></Comment>}></Route>     
          <Route exact path="/login" render={(props) => <Login {...props}></Login>}></Route> 
        </Switch>
        <Redirect  to={'/booktown'}/>
      </Router>
    )
  }
}

export default App;
